Skip to content

Conversation

@addaleax
Copy link
Collaborator

When running under nyc for coverage generation, the process's process.exit() internals get monkey-patched to give nyc the opportunity to write coverage data as part of that operation. However, for processes running under changed working directories, nyc may try to write to an incorrect directory, making the fs.writeFile() call fail with an exception, and so process.exit() may not actually stop the process.

This commit adds a process.abort() call to make that accounts for this situation, as well as improved debugging for it.

…nder coverage

When running under `nyc` for coverage generation, the process's
`process.exit()` internals get monkey-patched to give `nyc` the opportunity
to write coverage data as part of that operation. However, for processes
running under changed working directories, `nyc` may try to write to an incorrect
directory, making the `fs.writeFile()` call fail with an exception,
and so `process.exit()` may not actually stop the process.

This commit adds a `process.abort()` call to make that accounts for this situation,
as well as improved debugging for it.
@addaleax addaleax merged commit 5405fe4 into main Dec 13, 2024
148 of 152 checks passed
@addaleax addaleax deleted the 1943-process-exit-again branch December 13, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants